################################################################################
# Judicial Ideology as Text -- Table A1 (Weighting Schemes)
# Truscott & Romano
# Updated February 2025
################################################################################

################################################################################
# Necessary Packages & Dependencies
################################################################################

source('R/truscott_romano_source.R')


################################################################################
# Table A1: Weights Classifications
################################################################################


weights_tibble <- tibble::tribble(
  ~`Scheme (Responsibility)`, ~Condition, ~Majority, ~Concurrence, ~`(Other) Concurrence`, ~Dissent,
  "Full", "JM (Exclusively)", "1.0", "", "", "",
  "", "JM AC", "1.0", "1.0", "", "",
  "", "JM ASC", "1.0", "", "1.0", "",
  "", "JM JSC", "1.0", "", "1.0", "",
  "", "AD (Exclusively)", "", "", "", "1.0",

  "High", "JM (Exclusively)", "0.9", "", "", "",
  "", "JM AC", "0.9", "1.0", "", "",
  "", "JM ASC", "0.75", "", "1.0", "",
  "", "JM JC", "0.75", "0.9", "", "",
  "", "JM JSC", "0.75", "", "0.75", "",
  "", "AD (Exclusively)", "", "", "", "1.0",

  "Low", "JM (Exclusively)", "0.75", "", "", "",
  "", "JM AC", "0.75", "1.0", "", "",
  "", "JM ASC", "0.5", "", "1.0", "",
  "", "JM JC", "0.5", "0.75", "", "",
  "", "JM JSC", "0.5", "", "0.75", "",
  "", "AD (Exclusively)", "", "", "", "1.0",

  "Sole", "JM (Exclusively)", "", "", "", "",
  "", "JM AC", "", "1.0", "", "",
  "", "JM ASC", "", "", "1.0", "",
  "", "JM JC", "", "", "", "",
  "", "JM JSC", "", "", "", "",
  "", "AD (Exclusively)", "", "", "", "1.0"
)

table_A1_text <- stargazer(weights_tibble, type = 'text', summary = F, rownames = F)
table_A1_latex <- stargazer(weights_tibble, type = 'latex', summary = F, rownames = F, label = 'tab:table_A1', title = 'Associative Weighting Schemes by Opinion Authorship', style = 'apsr')

writeLines(table_A1_text, 'tables/table_A1_text.txt', sep = '\n')
writeLines(table_A1_latex, 'tables/table_A1_latex.txt', sep = '\n')



